<?php get_backend_header(array(
	'jquery/validate/jquery.validate.js',
        'jquery/validate/additional-methods.js',
	'lesson.js',
), array(
	'jquery/ui.jqgrid.css'
)); ?>

<?php get_group_sidebar($group_id); ?>
<div id ="content" >
    <h2 class="title"><?php echo ($lesson_id) ?  'Edit' : 'Add'; ?> Lesson</h2>

    <form id="lesson_form" name="lesson_form" class="form">
            <input type="hidden" id="group_id" name="group_id" value="<?php echo $group_id; ?>" />
            <input type="hidden" id="lesson_id" name="lesson_id" value="<?php echo $lesson_id; ?>" />

                <div class="unit">

                    <div class="line">
                            <label for="" class="bold">Lesson name:</label>
                            <div class="field" style="height:auto">
                              <input type="text" name="lesson_name" id="lesson_name" value="<?php echo $lesson_name; ?>"/>
                            </div>
                    </div>

                </div>


            <div class ="clear"></div>

            <div class="buttons">
                    <button id="save" name="save">Save</button>
                    <a href="<?php echo site_url('lesson/list_records/'.$group_id); ?>" id="cancel" name="cancel">Cancel</a>
            </div>
    </form>
    
</div>


<script type="text/javascript">
        lessonRules();

	$('#cancel').button({
		icons: {primary: 'ui-icon-arrowreturn-1-w'}
	});	
	
	$('#save').button({
		icons: {primary: 'ui-icon-disk'}
	}).click(function(e) {
                e.preventDefault();
		$(this).removeClass('ui-state-focus');
		$('#lesson_form').submit();
	});	

</script>

<?php get_backend_footer(); ?>
